package appapi.mapper;

import appapi.entity.bridge.DeviceOpenLogEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @version: java version 1.8
 * @Author: Ygp Work
 * @description:
 * @date: 2023-09-15 15:38
 */

@Mapper
public interface DeviceOpenLogMapper extends BaseMapper<DeviceOpenLogEntity> {
    @Select("SELECT dol.* FROM device_open_log dol " +
            "JOIN project p ON dol.proj_id = p.proj_id " +
            "JOIN organization org ON p.orga_id = org.orga_id " +
            "WHERE org.orga_id = #{orgaId}")
    List<DeviceOpenLogEntity> listByOrgaId(@Param("orgaId") Integer orgaId);

}